package io.gitee.chearnee.fw.datasecurity.core.executor.desensitization;

import java.lang.annotation.Annotation;
import java.util.Set;

/**
 * @author cn
 * @version 1.0
 * @description
 * @date 11/10/2022 3:59 PM
 */
public class ArraySDExecutor implements SDExecutor<Object> {
    @Override
    public Object execute(Object obj, Annotation generalField, Set<Class<?>> disabledClasses) {
        Object[] newObj = (Object[]) obj;
        for (int i = 0; i < newObj.length; i++) {
            newObj[i] = SDExecutorFactory.getSDExecutor(newObj[i]).executeObject(newObj[i], generalField, disabledClasses);
        }
        return obj;
    }
}
